package com.mechat.ui.my

import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mechat.R
import io.rong.imkit.event.EnumEventTag
import com.gyf.immersionbar.ImmersionBar
import com.custom.base.mvp.MVPBaseFragment
import com.sunday.eventbus.SDBaseEvent
import kotlinx.android.synthetic.main.frag_my.*

/**
 * 作者：
 * 时间：
 * 描述：我的
 */
class MyFragment : MVPBaseFragment<MyContract.View, MyPresenter>(), MyContract.View {

    override fun bindLayout(): Int {
        return R.layout.frag_my
    }

    override fun initView(view: View) {
        mPresenter?.getData()
        ImmersionBar.with(this)
            .statusBarColor("#f6f6f6")
            .statusBarDarkFont(true)
            .init()
    }

    override fun onEventMainThread(event: SDBaseEvent) {
        when (EnumEventTag.valueOf(event.tagInt)) {

            else -> {}
        }
    }

    override fun onHiddenChanged(hidden: Boolean) {
        super.onHiddenChanged(hidden)
        if (!hidden){
            ImmersionBar.with(this)
                .statusBarColor("#f6f6f6")
                .statusBarDarkFont(true)
                .init()
        }
    }




    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        mPresenter?.onActivityResult(requestCode, resultCode, data)
    }

    override val myUserName: TextView
        get() = my_user_name
    override val myUserId: TextView
        get() = my_user_id
    override val myLogOut: TextView
        get() = my_log_out
    override val myModelList: RecyclerView
        get() = my_model_list

}